package net.pinnoocle.playdao.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.pinnoocle.playdao.entity.Room;
import net.pinnoocle.playdao.entity.shopPc.room.RoomListPageVo;
import net.pinnoocle.playdao.entity.shopPc.room.RoomListSearchParams;
import net.pinnoocle.playdao.entity.shopPc.room.RoomListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 房间表(Room)表数据库访问层
 *
 * @author ye
 * @since 2021-10-21 09:40:37
 */
@Mapper
public interface RoomDao extends BaseMapper<Room> {

    /**
     * 房间列表
     * @param page
     * @param params
     * @return
     */
    Page<RoomListPageVo> roomListWithPage(Page page, @Param("params")RoomListSearchParams params);

    /**
     * 获取房间总数
     * @param shopId
     * @return
     */
    int getTotalRoom(@Param("shopId")String shopId);

    /**
     * 获取使用中的房间数
     * @param shopId
     * @return
     */
    int getUsedTotalRoom(@Param("shopId")String shopId);
}